package controllers;

import play.*;
import play.i18n.Lang;
import play.i18n.Messages;
import play.mvc.*;

import java.util.*;


import models.*;

public class Application extends Controller {

    public static void index() {
    	
    	System.out.println("LANG: " + Lang.getLocale().getCountry());
    	
    	System.out.println("NAME: " + Messages.get("application.name"));
    	
        render();
    }
    
    
    public static void testLog(){
    	Logger.info("Log message: Hello!");
    	
    	Logger.error("Log message: Has a error !!!");
    	
    	renderText("Test write log");
    }
    
    public static void changeLang(String lang)
    {
    	if(lang == null || lang.isEmpty())
    		lang = "en";
    	
    	Lang.change(lang);
    	
    	index();
    }
    
    public static void upload(){
    	long time = System.currentTimeMillis();
    	
        render(time);
    }
}